package com.lagou.edu.controller;

import com.lagou.edu.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/email")
public class EmailController {


    @Autowired
    private EmailService emailService;

    //"/resume/openstate/1545132"
    @GetMapping("/{email}/{code}")
    public boolean sendEmail(@PathVariable String email,@PathVariable String code) {

        List<String> list = new ArrayList<>();
        list.add(email);
        return emailService.sendEmail(list, code);
    }
}
